home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Aug 89 / X0033-RespondsTo -Aug89 < prev    next >
Encoding:
Text File  |  1989-08-22  |  1.6 KB  |  38 lines  |  [TEXT/GEOL]

  1. Item    2938085                         10-Aug-89        15:28
  2.  
  3. From:   D1220                           Vari-Lite, Andy Meldrum,PRT
  4.  
  5. To:     MACAPP.TECH$                    MACAPP Tech
  6.  
  7. Sub:    RespondsTo:
  8.  
  9. I want, I want #99 in a series !!
  10.  
  11.     Smalltalk has a 'RespondsTo' method of TObject that allows objects to be
  12. interrogated for the presence or otherwise of a particular method.
  13.  
  14.     At this exact instant in time ( like right now ) I have a variety of
  15. objects with screen representations (sets, pipes, targets, automatedlights) and
  16. can have any combination of objects selected at any instant. There is no user
  17. restriction on sending commands that don't make sense to objects. The problem
  18. is that I must put all the potential methods that ALL of these objects could
  19. possibly receive into each object to save compiler errors. i.e a setpiece must
  20. have a MakeSetIntensityCmd method that does nothing at all ( since a setpiece
  21. has no intensity ) as I will blindly enumerate the selected Objects. I could do
  22. MemberOf testing, however this is an example of the kind of thing that one is
  23. not supposed to do ( MPW 2.0.2 Reference, 12-10 ).
  24.  
  25.    I would like to query the objects, as I enumerate them, with a
  26. 'RespondsTo:MakeSetIntensityCmd' message, say. Clearly I'd have to Typecast the
  27. Object before making the SetAbsColor call on an object that did have that
  28. method ( does Smalltalk take care of this too ??? ) but it would be better than
  29. nothing.
  30.  
  31.     Once again, I'd be real interested in a piece of code that could do this.
  32. On the other hand I may have missed something blindingly obvious that would
  33. work just as well. This would not be the first time !!
  34.  
  35. Andy.
  36.  
  37.  
  38.